# on Franklin, type the following commands: 
#  > module swap PrgEnv-pgi PrgEnv-cray/1.0.1
#  > module swap cce cce/7.3.2
#  > module load bupc
UPCC= upcc -O
CC = CC -O3

OS := $(shell uname -s)

ifeq ($(OS),Darwin)
	CC = g++ -O3
	UPCC = upcc -pthreads -O
endif

TARGETS= serial parallel bvs2 bl es

all: $(TARGETS)

serial: serial.cpp
	$(CC) -o $@ $^

parallel: parallel.upc
	$(UPCC) -o $@ $^ $(DFLAGS)

bvs2: bvs2.upc
	$(UPCC) -o $@ $^

bl: bl.upc
	$(UPCC) -o $@ $^ $(DFLAGS)

es: es.upc
	$(UPCC) -o $@ $^ $(DFLAGS)

clean:
	rm -f *.o $(TARGETS)
